package com.ruoyi.project.system.user.service;

import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.system.user.domain.ResUser;
import com.ruoyi.project.system.user.mapper.ResUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: moli
 * @Email: 974751082@qq.com
 * @qq: 974751082
 * @Date: 2021/5/7 15:14
 */
@Service
public class ResUserServiceImpl implements ResUserService {

    @Autowired
    private ResUserMapper resUserMapper;

    @Override
    @DataSource(DataSourceType.SLAVE)
    @Transactional
    public void insertRes() {
        ResUser resUser = new ResUser();
        resUser.setUsername("test");
        resUser.setPasswodHash("test");
        resUser.setSalt("test");
        resUserMapper.insertResUser(resUser);
    }
}
